home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / attachCrvToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.6 KB  |  122 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      attachCrvToolScript
  27. //
  28. //  Input Arguments:
  29. //      what is going to happen when this script is called
  30. //        $setToTool = 0 ==> do the command
  31. //        $setToTool = 1 ==> show option box
  32. //        $setToTool = 2 ==> return the command
  33. //        $setToTool = 3 ==> show tool option box
  34. //        $setToTool = 4 ==> enter the tool
  35. //
  36. //  Return Value:
  37. //      None.
  38. //
  39.  
  40. global proc attachCrvToolSetup( int $forceFactorySettings, string $goToTool )
  41. {
  42.     global int $gStartWithAutoComplete;
  43.     if( $forceFactorySettings || !`optionVar -ex attachCurveEuc` ) {
  44.         optionVar -iv attachCurveEuc 0;
  45.     }
  46.     if( $forceFactorySettings || !`optionVar -ex attachCurveLac` ) {
  47.         optionVar -iv attachCurveLac $gStartWithAutoComplete;
  48.     }
  49.     if( "" != $goToTool ) {
  50.         scriptCtx -e -euc `optionVar -q attachCurveEuc` $goToTool;
  51.         scriptCtx -e -lac `optionVar -q attachCurveLac` $goToTool;
  52.     }
  53. }
  54.  
  55. global proc attachCurveValues ( string $toolName ) 
  56. {
  57.     performAttachCrv 3 $toolName;
  58.     scriptCtxCommonValues( $toolName );
  59. }
  60.  
  61. global proc attachCurveProperties()
  62. {
  63.     scriptCtxCommonProperties;
  64. }
  65.  
  66. proc createAttachCrvContext( string $tool )
  67. {
  68.     if( ! `scriptCtx -exists $tool` ) {
  69.         attachCrvToolSetup( 0, "" );
  70.         scriptCtx
  71.           -i1 "attachCurves.xpm"
  72.           -bcn "attachCurve"
  73.  
  74.           -title "Attach Curves Tool"
  75.           -totalSelectionSets 1
  76.           -expandSelectionList true
  77.           -fcs ("attachCrvToolScript 0")
  78.  
  79.           -setNoSelectionPrompt ("Select two curves or curve points " +
  80.                                  " to attach.")
  81.           -setSelectionPrompt ("Select second curve or curve point " +
  82.                                " to attach.")
  83.           -setDoneSelectionPrompt ("Press ENTER to complete attach.")
  84.  
  85.           -setAutoToggleSelection true
  86.           -showManipulators true
  87.           -nurbsCurve true
  88.           -curveParameterPoint true
  89.           -curveOnSurface true
  90.  
  91.           -lastAutoComplete `optionVar -q attachCurveLac` 
  92.           -setSelectionCount 2 
  93.  
  94.           // If this was true, the tool would exit
  95.           // once the attach has been completed
  96.           -exitUponCompletion `optionVar -q attachCurveEuc` 
  97.         $tool;
  98.     }
  99. }
  100.  
  101. global proc string attachCrvToolScript( int $setToTool )
  102. //
  103. //    Description :
  104. //        $setToTool = 0 ==> do the command
  105. //        $setToTool = 1 ==> show option box
  106. //        $setToTool = 2 ==> return the command
  107. //        $setToTool = 3 ==> show tool/action option box
  108. //        $setToTool = 4 ==> enter the tool/do the command
  109. {
  110.     string $tool = "";
  111.     if( $setToTool > 2 ) {
  112.         if( !`optionVar -q modelWithToolAttachCurve` ) {
  113.             $setToTool = 4 - $setToTool;
  114.         }
  115.         else {
  116.             $tool = "attachCrvContext";
  117.             createAttachCrvContext $tool;
  118.         }
  119.     }
  120.     return scriptToolScript( "performAttachCrv", $setToTool, $tool );
  121. }
  122.